package com.fr.report.form;

import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.AbstractTableDataSource;
import com.fr.report.io.xml.ReportXMLUtils;
import com.fr.report.web.ui.Widget;
import com.fr.report.web.ui.container.Container;
import java.util.HashMap;

public class FormModel extends AbstractTableDataSource
  implements XMLable
{
  private static final long serialVersionUID = 8113907060011737400L;
  private transient HashMap map = new HashMap();
  private Container container;

  public FormModel()
  {
  }

  public Widget getWidget(String paramString)
  {
    Object localObject = this.map.get(paramString);
    if (localObject != null)
      return ((Widget)localObject);
    return null;
  }

  public void putWidget(String paramString, Widget paramWidget)
  {
    this.map.put(paramString, paramWidget);
  }

  public FormModel(Container paramContainer)
  {
    setContainer(paramContainer);
  }

  public Container getContainer()
  {
    return this.container;
  }

  public void setContainer(Container paramContainer)
  {
    this.container = paramContainer;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if ((paramXMLableReader.isChildNode()) && (paramXMLableReader.getTagName().endsWith("Container")))
      this.container = ((Container)ReportXMLUtils.readXMLable(paramXMLableReader));
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    ReportXMLUtils.writeXMLable(paramXMLPrintWriter, this.container, "Container");
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}